<#include "/WEB-INF/views/admin/common/layout/__mainlayout.html">
<#include "/WEB-INF/views/admin/common/__pagination.html">
<#assign navLink='admin:sys:stats:list' />
<#assign pageCss>
<link rel="stylesheet" href="${ctx}/resource/validationengine/css/validationEngine.jquery.css">
</#assign>
<#assign pageScript>
<script type="text/javascript" src="${ctx}/resource/validationengine/js/jquery.validationEngine-zh_CN.js"></script>
<script type="text/javascript" src="${ctx}/resource/validationengine/js/jquery.validationEngine.js"></script>
<script type="text/javascript">

$(document).ready(function() {
	laydate.render({
	    elem: '#search_date'
	    ,range: true
	  });
	$('#search_agentname').chosen();
	
	$("#batch_pay").click(function(){
		var selectedItem = [];
		$(".checkbox:checked").each(function(){
			selectedItem.push($(this).val());
		});
		var selected = selectedItem.join(",");
		if(selected != ''){
			$.ajax({
	            type: "GET",
	            url: "${ctx}/admin/sys/settlement/batchCheck?id="+selected,
	            dataType: "json",
	            success: function(data){
	            		if(data.success){
	            			layer.msg(data.errMsg, {
	            				icon : 1,
	            				time : 1000,
	            				end : function() {
	            					window.location.reload();
	            				}
	            			});
	            		}else{
	            			layer.msg(data.errMsg, {
	            				icon : 2,
	            				time : 1000,
	            				end : function() {
	            					window.location.reload();
	            				}
	            			});
	            		}
	                 }
	        });
		}else{
			layer.msg("please choose data", {
				icon : 2,
				time : 1000,
				end : function() {
					window.location.reload();
				}
			});
		}
		
	});
});

    function update(id) {
        layer.open({
            title: 'do settlement',
            type: 2,
            area: ['60%', '40%','no'],
            scrollbar: false,
            content: '${ctx}/admin/sys/settlement/update?id=' + id,
            end: function () {
                window.location.reload();
            }
        });
    	
    }

    function selectAll(checked) {
        $('.checkbox').prop('checked',checked);
    }

    function changeSelectAll(){
        var items = $('.checkbox');
        var allSelect = $('#AllSelectChk');
        var flag = 1;
        items.each(function (e,ele) {
            if(!$(ele).prop('checked')){
                flag = 0;
            }
        })
        allSelect.prop('checked',!!flag);
    }

</script>
</#assign>
<@mainlayout>
<div class="row-content am-cf">
    <div class="row  am-cf">
                    <div class="am-u-sm-12 am-u-md-12 am-u-lg-4">
                        <div class="widget am-cf">
                            <div class="widget-head am-cf">
                                <div class="widget-title am-fl">月度财务收支计划</div>
                                <div class="widget-function am-fr">
                                    <a href="javascript:;" class="am-icon-cog"></a>
                                </div>
                            </div>
                            <div class="widget-body am-fr">
                                <div class="am-fl">
                                    <div class="widget-fluctuation-period-text">
                                        ￥61746.45
                                        <button class="widget-fluctuation-tpl-btn">
                        <i class="am-icon-calendar"></i>
                        更多月份
                      </button>
                                    </div>
                                </div>
                                <div class="am-fr am-cf">
                                    <div class="widget-fluctuation-description-amount text-success" am-cf>
                                        +￥30420.56

                                    </div>
                                    <div class="widget-fluctuation-description-text am-text-right">
                                        8月份收入
                                    </div>
                                </div>
                            </div>
                        </div>

                    </div>
                    <div class="am-u-sm-12 am-u-md-6 am-u-lg-4">
                        <div class="widget widget-primary am-cf">
                            <div class="widget-statistic-header">
                                本季度利润
                            </div>
                            <div class="widget-statistic-body">
                                <div class="widget-statistic-value">
                                    ￥27,294
                                </div>
                                <div class="widget-statistic-description">
                                    本季度比去年多收入 <strong>2593元</strong> 人民币
                                </div>
                                <span class="widget-statistic-icon am-icon-credit-card-alt"></span>
                            </div>
                        </div>
                    </div>
                    <div class="am-u-sm-12 am-u-md-6 am-u-lg-4">
                        <div class="widget widget-purple am-cf">
                            <div class="widget-statistic-header">
                                本季度利润
                            </div>
                            <div class="widget-statistic-body">
                                <div class="widget-statistic-value">
                                    ￥27,294
                                </div>
                                <div class="widget-statistic-description">
                                    本季度比去年多收入 <strong>2593元</strong> 人民币
                                </div>
                                <span class="widget-statistic-icon am-icon-support"></span>
                            </div>
                        </div>
                    </div>
                </div>
</div>
</@mainlayout>

